$(function () {
    // 1.获取路由
    
    let menuPosts = $('#menu-posts');
    let menuSettings= $('#menu-settings')
    let routerName = itcast.getRouterName(location.href)
   


    // 2.判断是否满足参数,实现展开
    if (routerName == 'posts' || routerName == 'post-add' || routerName == "categories") {
        // 3.实现展开
        menuPosts.addClass('in').attr('aria-expanded',true)

    }
    // 给列表价样式
    $('#'+routerName).addClass('active')
    // 2.判断是否满足参数,实现展开
    if (routerName == 'nav-menus' || routerName == 'slides' || routerName == "settings") {
        // 3.实现展开
        menuSettings.addClass('in').attr('aria-expanded',true)

    }
})